<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>接种查验机构管理</title>
	<meta name="decorator" content="default"/>
	<%@include file="/WEB-INF/views/include/treeview.jsp" %>
	<style type="text/css">
		.ztree {overflow:auto;margin:0;_margin-top:10px;padding:10px 0 0 10px; color: #000;}
	</style>
</head>
<body>
	<sys:message content="${message}"/>
	<div id="content" class="row-fluid">
		<div id="left" class="accordion-group">
			<div id="ztree" class="ztree"></div>
		</div>
	</div>
	<script type="text/javascript">
	   
		var setting = {data:{simpleData:{enable:true,idKey:"id",pIdKey:"pId",rootPId:'0'}},
			callback:{
				onClick:function(event, treeId, treeNode){
					//获得选中的节点值
					var treeObj=$.fn.zTree.getZTreeObj("ztree");
	           		nodes=treeObj.getSelectedNodes();
	           		window.parent.location.reload(); //刷新当前页面
	           		$.ajax({
							type: "post",
							dataType: "json",
							url: "${ctx}/bsHpccHSummary/cache/saveDeptLevel",
							data: {officeId:nodes[0].id,officeName:nodes[0].name},
							timeout: 60000,
							success: function(data){
								
							}
					});
				}
			}
		};
		
		function refreshTree(){
			$.getJSON("${ctx}/sys/office/treeData",function(data){
				$.fn.zTree.init($("#ztree"), setting, data).expandAll(true);
			});
		}
		
		refreshTree();
		
		var leftWidth = "350"; // 左侧窗口大小
		var htmlObj = $("html"), mainObj = $("#main");
		var frameObj = $("#left, #openClose, #right, #right iframe");
		function wSize(){
			var strs = getWindowSize().toString().split(",");
			htmlObj.css({"overflow-x":"hidden", "overflow-y":"hidden"});
			mainObj.css("width","auto");
			frameObj.height(strs[0] - 5);
			var leftWidth = ($("#left").width() < 0 ? 0 : $("#left").width());
			$("#right").width($("#content").width()- leftWidth - $("#openClose").width() -5);
			$(".ztree").width(leftWidth - 10).height(frameObj.height() - 46);
		}
	</script>
	
	<script src="${ctxStatic}/common/wsize.min.js" type="text/javascript"></script>

</body>
</html>